home *** CD-ROM | disk | FTP | other *** search
/ Java Primer Plus / Java Primer Plus (Waite Group Proess)(1996).iso / chapter10 / testrun.java < prev    next >
Text File  |  1995-12-31  |  357b  |  20 lines

  1.     /* This class is out to cause trouble */
  2.     class testrun {
  3.     
  4.       static int a[];
  5.     
  6.      static public void main (String args[]) {
  7.         allocer();
  8.         System.gc();
  9.         System.out.println(a[1]);
  10.         }
  11.  
  12.     /* method to create an array then die */
  13.      static void allocer() {
  14.         int x[] = new int[10];
  15.         x[1] = 5;
  16.         a = x;
  17.         }
  18.       }
  19.  
  20.